class SearchesController < ApplicationController
  filter_access_to :all

  def show
    @search_term = params[:query].to_s.split
    @search_string = @search_term.to_sentence( :words_connector => " ",
                                               :last_word_connector => " ",
                                               :two_words_connector => " " )

    if !@search_term.empty?
      @artists = Artist.name_like_all(@search_term)
      @releases = Release.title_like_all(@search_term)
      @songs = Song.title_like_all(@search_term)
      @labels = Label.name_like_all(@search_term)
      @genres = Genre.name_like_all(@search_term)
    end
  end

end
